//
//  PaperAssessmentCollectionViewCell.m
//  智云题库
//
//  Created by 毕武侠 on 2017/4/5.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperAssessmentCollectionViewCell.h"
#import "PaperAssessmentCardAnswerModel.h"

@interface PaperAssessmentCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIView *backView;
@property (weak, nonatomic) IBOutlet UILabel *title;

@end

@implementation PaperAssessmentCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.backView.layer.borderColor = RGB(180, 180, 180).CGColor;
    self.backView.layer.borderWidth = 0.8f;
    self.backView.layer.cornerRadius = 20.0;
    self.backView.layer.masksToBounds = YES;
}

- (void)bindModel:(PaperAssessmentCardAnswerModel *)model {
    self.title.text = model.question_number;
    
    if (model.is_right == 0) {  // 错
        self.backView.layer.borderWidth = 0.0f;
        self.backView.layer.borderColor = RGB(255, 35, 68).CGColor;
        self.backView.backgroundColor = RGB(255, 35, 68);
        self.title.textColor = [UIColor whiteColor];
    } else if (model.is_right == 1) {   // 对
        self.backView.layer.borderWidth = 0.0f;
        self.backView.layer.borderColor = MainThemeColor.CGColor;
        self.backView.backgroundColor = MainThemeColor;
        self.title.textColor = [UIColor whiteColor];
    } else {    // 未答
        self.backView.layer.borderWidth = 0.8f;
        self.backView.layer.borderColor = RGB(234, 234, 234).CGColor;
        self.backView.backgroundColor = [UIColor whiteColor];
        self.title.textColor = MainThemeColor;
    }
}

@end
